<?php
// +----------------------------------------------------------------------
// | 幕小铺
// +----------------------------------------------------------------------
// | 版权所有 2016~2020 幕小铺科技（大连）有限公司
// +----------------------------------------------------------------------
// | 2020/03/14
// +----------------------------------------------------------------------
namespace app\video\behavior\cancel_support_before;

/**
 * 校验是否已经点过赞
 * @package app\user_center\behavior\user
 * @author jason wang
 */
class checkSupport{
    /**
     * 执行行为 run方法是Behavior唯一的接口
     * @access public
     * @return void
     */
    public function run($params){
    	$uid 	 = $params['user_id'];
    	$play_id = $params['play_id'];

        //判断是否已经点过赞了
        $map = [];
        $map['uid']     = $uid;
        $map['play_id'] = $play_id;
        
        if(model('VideoPlaySupport') -> where($map) -> find()){
            return array_out(-1001, '您已经点过赞了');
        }
    }
}
